#include <iostream>

using namespace std;

class Shape {
	public:
		Shape(int len = 0) : m_len(len) {}
		virtual int area(void) = 0;
		virtual int volume(void) = 0;
	protected:
		int m_len;
};

class Rect : public Shape {
	public:
		Rect(int len, int width) : Shape(len), m_width(width) {}
		int area(void) {return m_len * m_width;}
	
	protected:
		int m_width;
};

class Cuboid : public Rect {
	public:
		Cuboid(int len, int width, int height) : Rect(len, width), m_height(height) {}
		int area(void) {return 2 * (m_len * m_width + m_len * m_height + m_width * m_height);}
		int volume(void) {return m_width * m_len * m_height;}
	protected:
		int m_height;
};

int main(void)
{
	Cuboid c(1, 2, 3);

	cout << c.area() << endl;
	cout << c.volume() << endl;

	return 0;
}

